import type { Component } from "@/types/custom.ts";
import { markRaw } from "vue";
type extendedComponent = Component & {
  default: any;
};
type ComponentsObject = {
  [fileNameWithoutExt: string]: extendedComponent;
};
let resComps: ComponentsObject = {};
const allComponents: ComponentsObject = import.meta.glob("./*.vue", {
  eager: true,
});
for (const key in allComponents) {
  if (Object.prototype.hasOwnProperty.call(allComponents, key)) {
    const comp: extendedComponent = allComponents[key];
    resComps[comp.default.name] = markRaw(comp.default);
  }
}
export default resComps;
